package com.tester.zc.test002.threadLocal;

/**
 * 生产者
 *
 * @Author zhoucan
 * @Date 2022/12/11
 */
public class Producer implements Runnable{
    private Resource resource;

    Producer(Resource resource){
        this.resource = resource;
    }
    public void run(){
        for (int i = 0; i < 10; i++) {
            try {
                this.resource.create();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
